package com.rednote.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.rednote.entity.Posts;

import com.rednote.entity.vo.PostCardVO;
import com.rednote.entity.vo.PostVO;
import org.apache.mahout.cf.taste.common.TasteException;

import java.util.List;

/**
 * 用户帖子表(Posts)服务接口
 *
 * @author yao suxuan
 * @since 2025-05-24 18:10:30
 */
public interface PostsService extends IService<Posts> {

    /**
     * 获取帖子详情
     */
    PostVO getPostDetail(Integer postId, int page, int pageSize) throws JsonProcessingException;

    /**
     * 删除帖子
     */
    void removePostById(Integer id);

    /**
     * 推荐帖子
     */
    List<PostCardVO> recommend(int cursor, int limit);

    /**
     * 获取我的帖子列表
     */
    List<PostCardVO> getMyPosts(Integer userId, Integer page, Integer size);


    Page<PostCardVO> searchPosts(String keyword, Integer page, Integer limit, String tag);

    Page<PostCardVO> getMyLikedPosts(Integer userId, Integer page, Integer size);

    Page<PostCardVO> recommendSimilarPosts(Integer userId, Integer page, Integer size) throws TasteException;
}
